package com.ywjg.utils;

import java.util.HashMap;
import java.util.Map;

import com.ywjg.model.AppGood;
import com.ywjg.model.GoodToOrder;
import com.ywjg.model.NewsMessage;

public class TTT {

	public static GoodToSBSBGood appUserToSb(AppGood appGood) {
		Map<String, String> map2 = new HashMap<String, String>();
		Map<String, Integer> map3 = new HashMap<String, Integer>();
		Map<String, Integer> map4 = new HashMap<String, Integer>();
		Map<String, Integer> map5 = new HashMap<String, Integer>();
		Map<String, String> map6 = new HashMap<String, String>();
		Map<String, String> map7 = new HashMap<String, String>();
		Map<String, Integer> map8 = new HashMap<String, Integer>();
		Map<String, String> map9 = new HashMap<String, String>();
		Map<String, Integer> map10 = new HashMap<String, Integer>();
		Map<String, Integer> map11 = new HashMap<String, Integer>();
		Map<String, Integer> map12 = new HashMap<String, Integer>();
		Map<String, Integer> map13 = new HashMap<String, Integer>();
		
		
		Map<String, String> map14 = new HashMap<String, String>();
		
		Map<String, Integer> map15 = new HashMap<String, Integer>();


		GoodToSBSBGood goodToSBSBGood = new GoodToSBSBGood();
		map14.put("value", appGood.getGoodAddress());
		goodToSBSBGood.setGoodAddress(map14);

		map13.put("value", appGood.getGoodAllowComment());
		goodToSBSBGood.setGoodAllowComment(map13);

		map2.put("value", appGood.getGoodDescription());
		goodToSBSBGood.setGoodDescription(map2);

		map3.put("value", appGood.getGoodIsDelete());
		goodToSBSBGood.setGoodIsDelete(map3);

		map4.put("value", appGood.getGoodIsNew());
		goodToSBSBGood.setGoodIsNew(map4);

		map5.put("value", appGood.getGoodIsShow());
		goodToSBSBGood.setGoodIsShow(map5);

		map6.put("value", appGood.getGoodLogo());
		goodToSBSBGood.setGoodLogo(map6);

		map7.put("value", appGood.getGoodName());
		goodToSBSBGood.setGoodName(map7);

		map8.put("value", appGood.getGoodShopId());
		goodToSBSBGood.setGoodShopId(map8);

		map9.put("value", appGood.getGoodShopName());
		goodToSBSBGood.setGoodShopName(map9);

		map10.put("value", appGood.getGoodTypeId());
		goodToSBSBGood.setGoodTypeId(map10);

		map11.put("value", appGood.getIsFixing());
		goodToSBSBGood.setIsFixing(map11);

		map12.put("value", appGood.getSaleNumber());
		goodToSBSBGood.setSaleNumber(map12);
		
		
		map15.put("value", appGood.getAllGoodModel().get(0).getThisModelPrice());
		goodToSBSBGood.setSaleNumber(map12);
		
		

		UserData data = new UserData(appGood.getId());
		goodToSBSBGood.setUserdata(data);

		return goodToSBSBGood;
	}

	public static OrderTOSBOrder orderToSbSBOrder(GoodToOrder goodToOrder) {

		Map<String, Integer> map2 = new HashMap<String, Integer>();
		Map<String, Integer> map3 = new HashMap<String, Integer>();
		Map<String, String> map4 = new HashMap<String, String>();
		Map<String, String> map5 = new HashMap<String, String>();
		Map<String, String> map6 = new HashMap<String, String>();
		Map<String, String> map7 = new HashMap<String, String>();
		Map<String, Integer> map8 = new HashMap<String, Integer>();
		
		UserData data = new UserData(goodToOrder.getId());

		OrderTOSBOrder orderTOSBOrder = new OrderTOSBOrder();
		orderTOSBOrder.setUserdata(data);
		map2.put("value", goodToOrder.getGoodId());
		orderTOSBOrder.setGoodId(map2);

		map3.put("value", goodToOrder.getGoodNumber());
		orderTOSBOrder.setGoodNumber(map3);
		map4.put("value", goodToOrder.getTrackingNumber());
		orderTOSBOrder.setTrackingNumber(map4);
		map5.put("value", goodToOrder.getGoodLogo());
		orderTOSBOrder.setGoodLogo(map5);
		map6.put("value", goodToOrder.getGoodShopName());
		orderTOSBOrder.setGoodShopName(map6);
		map7.put("value", goodToOrder.getGoodName());
		orderTOSBOrder.setGoodName(map7);
		map8.put("value", goodToOrder.getGoodPrice());
		orderTOSBOrder.setGoodPrice(map8);

		return orderTOSBOrder;
	}
	
	
	
	public static SBNews NewsToSBNews(NewsMessage newsMessage) {

		Map<String, String> map4 = new HashMap<String, String>();
		Map<String, String> map5 = new HashMap<String, String>();
		Map<String, String> map6 = new HashMap<String, String>();
		UserData data = new UserData(newsMessage.getId());
		SBNews sbNews = new SBNews();
		sbNews.setUserdata(data);
		map4.put("value", newsMessage.getNewContent());
		sbNews.setNewContent(map4);
		map5.put("value", newsMessage.getNewsTitle());
		sbNews.setNewsTitle(map5);
		map6.put("value", newsMessage.getNewsImg());
		sbNews.setNewsImg(map6);
		return sbNews;
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	

}
